Component({
  data: {
    selected: 0,
    color: "#999999",
    selectedColor: "#4141f3",
    list: [{
      pagePath: "/pages/student/index/index",
      text: "首页",
      iconPath: "/images/home.png",
      selectedIconPath: "/images/home_selected.png"
    }, {
      pagePath: "/pages/xiaoxi/xiaoxi",
      text: "消息",
      iconPath: "/images/message.png",
      selectedIconPath: "/images/message_selected.png"
    }, {
      pagePath: "/pages/wode/wode",
      text: "我的",
      iconPath: "/images/my.png",
      selectedIconPath: "/images/my_selected.png"
    }]
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset;
      const url = data.path;
      wx.switchTab({
        url
      });
      this.setData({
        selected: data.index
      });
    }
  }
})